/*
 *  Copyright (c) 2022 ZhuHai Jieli Technology Co.,Ltd.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

#ifndef _BTSTACK_TYPEDEF_H_
#define _BTSTACK_TYPEDEF_H_

#include "typedef.h"

#define BD_ADDR_LEN 6
typedef uint8_t bd_addr_t[BD_ADDR_LEN];

typedef uint16_t hci_con_handle_t;

typedef int (*sm_stack_packet_handler_t)(uint8_t packet_type, uint8_t *packet, uint16_t size);

typedef void (*btstack_packet_handler_t)(u8 packet_type, u16 channel, u8 *packet, u16 size);

typedef void (*ble_cbk_handler_t)(void);

void reverse_bd_addr(const bd_addr_t src, bd_addr_t dest);

void reverse_bytes(const u8 *src, u8 *dst, u32 len);

uint16_t little_endian_read_16(const uint8_t *buffer, int pos);
uint32_t little_endian_read_24(const uint8_t *buffer, int pos);
uint32_t little_endian_read_32(const uint8_t *buffer, int pos);

#endif
